package com.hxzy.demo.Adapter0926;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.hxzy.demo.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Yang on 2016/9/26.
 */
public class TestBaseAdapterActivity1 extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_list_view);
        final List<ContactEntity> contacts = new ArrayList<>();
        contacts.add(new ContactEntity("希尔瓦娜斯","X",R.mipmap.icon_sc));
        contacts.add(new ContactEntity("凯瑞甘","K",R.mipmap.icon_krg));
        contacts.add(new ContactEntity("吉安娜","J",R.mipmap.icon_jan));
        contacts.add(new ContactEntity("诺娃","N",R.mipmap.icon_nw));
        contacts.add(new ContactEntity("维拉","W",R.mipmap.icon_wl));

        ListView lv = (ListView) findViewById(R.id.lv);


        lv.setAdapter(new ContactAdapter(contacts));
    }
}
